import { ObjCreate } from "../../../common/ObjCreate";
import { GuideArrow } from "../../../guide/GuideArrow";
import { GuideArrowManager } from "../../../../manager/GuideArrowManager";
import { GTextFiled } from "../../../../../../com/mui/controls/GTextFiled";
type int = number;
//class CrossDefenceCopyGuideItem
    
    export  class CrossDefenceCopyGuideItem /* flash.display.Sprite */
    {
        

        public update(arg1: string, arg2: Function, arg3: int=40, arg4: int=40): void
        {
            var loc1=null;
            this._callback = arg2;
            if (this._clickRegion == null) 
            {
                this._clickRegion = new Object /* flash.display.Sprite */();
                this._clickRegion.addEventListener(flash.events.MouseEvent.CLICK, this.clickMeHandler);
            }
            this._clickRegion.graphics.clear();
            this._clickRegion.graphics.beginFill(16711680, 0);
            this._clickRegion.graphics.drawRoundRect(0, 0, arg3, arg4, 2, 2);
            this._clickRegion.graphics.endFill();
            this._clickRegion.x = 32;
            this._clickRegion.y = 140;
            this._clickRegion.cacheAsBitmap = true;
            this._clickRegion.buttonMode = true;
            this.addChild(this._clickRegion);
            if (this._bg == null) 
            {
                this._bg = ObjCreate.createBg(0, 0, 190, 40, this);
            }
            if (this._txtGuide == null) 
            {
                this._txtGuide = ObjCreate.createGTextField("", 8, 8, 180, 20, this);
                this._txtGuide.multiline = true;
                this._txtGuide.wordWrap = true;
                (loc1 = this._txtGuide.defaultTextFormat).size = 14;
                loc1.bold = true;
                loc1.color = 16776960;
                this._txtGuide.defaultTextFormat = loc1;
            }
            if (this._arrow != null) 
            {
                this._arrow.dispose();
            }
            this._arrow = new GuideArrow();
            this._arrow.updateDir(GuideArrowManager.Dir_B);
            this.addChild(this._arrow);
            this._arrow.x = this._clickRegion.x + this._clickRegion.width / 2;
            this._arrow.y = 130;
            this._txtGuide.htmlText = "<font color=\'#ffff00\'>" + arg1 + "</font>";
            return;
        }

        public get clickRegoin(): Object /* flash.display.Sprite */
        {
            return this._clickRegion;
        }

        /* internal  */clickMeHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._callback != null) 
            {
                this._callback.apply();
            }
            return;
        }

        /* internal */ /* var */_arrow: GuideArrow;

        /* internal */ /* var */_txtGuide: GTextFiled;

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_clickRegion: Object /* flash.display.Sprite */;

        /* internal */ /* var */_callback: Function;
    }
